#include <iostream> 
#include <string> 
 
using namespace std; 
 
int main() { 
  cout << "Input parenthesis sequence:\n"; 
  string s, s1; 
    getline(cin, s); 
     
    for (int i = 0; i < s.length(); i++) { 
      char chr = s[i]; 
      if (chr == '(') { 
        s1 += chr; 
    } 
    if (chr == ')') { 
      if (s1.length() > 0) { 
        if (s1[s1.length() - 1] == '(') { 
          s1 = s1.substr(0, s1.length() - 1); 
        } 
      } 
    } 
     
    if (chr == '[') { 
        s1 += chr; 
    } 
    if (chr == ']') { 
      if (s1.length() > 0) { 
        if (s1[s1.length() - 1] == '[') { 
          s1 = s1.substr(0, s1.length() - 1); 
        } 
      } 
    } 
    if (chr == '{') { 
        s1 += chr; 
    } 
    if (chr == '}') { 
      if (s1.length() > 0) { 
        if (s1[s1.length() - 1] == '{') { 
          s1 = s1.substr(0, s1.length() - 1); 
        } 
      } 
    } 
    if (chr == '<') { 
        s1 += chr; 
    } 
    if (chr == '>') { 
      if (s1.length() > 0) { 
        if (s1[s1.length() - 1] == '<') { 
          s1 = s1.substr(0, s1.length() - 1); 
        } 
      } 
    } 
  } 
   
  if (s1.size() == 0) { 
    cout << "Correct\n"; 
  } else { 
    cout << "Incorrect\n"; 
  } 
   
  return 0; 
}
